package com.ljq.rpc.common.pojo;

public class Request {
    private String serviceName;
    private String methodName;
    private Object[] parameters;
    private Class<?>[] parametersType;

    public Request(String serviceName, String methodName, Object[] parameters) {
        this.serviceName = serviceName;
        this.methodName = methodName;
        this.parameters = parameters;
        this.parametersType = new Class[this.parameters.length];
        for (int i = 0; i < this.parameters.length; i++) {
            parametersType[i] = parameters[i].getClass();
        }
    }

    public Request(String serviceName, String methodName, Object[] parameters, Class<?>[] parametersType) {
        this.serviceName = serviceName;
        this.methodName = methodName;
        this.parameters = parameters;
        this.parametersType = parametersType;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Object[] getParameters() {
        return parameters;
    }

    public void setParameters(Object[] parameters) {
        this.parameters = parameters;
    }

    public Class<?>[] getParametersType() {
        return parametersType;
    }

    public void setParametersType(Class<?>[] parametersType) {
        this.parametersType = parametersType;
    }
}
